<?php

require_once 'psk_dbtable.php';

class indexController extends PSK_Controller
{
	/**
	 * @var PSK_DBQuery_Base
	 */
	public $posts = null;
	
	function indexAction()
	{
		$this->posts = $this->db->Query('SELECT id_posts, title, body FROM posts');
		$this->RenderView('index');
	}
	
	function detailsAction() 
	{
		$this->posts = $this->db->Query('SELECT * FROM posts WHERE id_posts = '.
				$this->uri->Parameter(0));
		$this->RenderView('details');
	}
    
    function tesbihAction()
    {
        $a = 0;
        $a = $this->session->Read('a');
        $this->log->WriteDebug($a);
        $this->session->Write($a + 1, 'a');
    }
}
?>
